// 柯里化
// function checkAge(age) {
//     let min = 18;
//     return age >= 18;
// }

// function checkAge(min, age) {
//     return age >= min;
// }

// console.log(checkAge(18,20));
// console.log(checkAge(18,23));
// console.log(checkAge(22,23));

// function checkAge(min) {
//     return age => age >= min;
// }

// ES6
let checkAge = min => (age => age >= min);

let checkAge18 = checkAge(18);
let checkAge20 = checkAge(20);
console.log(checkAge18(20));
console.log(checkAge20(17));